/* 
* Copyright (C) 2011-2018 ShenZhen iBOXSaaS Information Technology Co.,Ltd. 
* 
* All right reserved. 
* 
* This software is the confidential and proprietary 
* information of iBOXSaaS Company of China. 
* ("Confidential Information"). You shall not disclose 
* such Confidential Information and shall use it only 
* in accordance with the terms of the contract agreement 
* you entered into with iBOXSaaS inc. 
* 
*/

 package com.iboxpay.open.auth.center.validate.impl;

import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.iboxpay.open.common.constants.ParamEnums;
import org.iboxpay.open.common.constants.ResultEnums;
import org.iboxpay.open.common.exception.ParamValidateException;
import org.springframework.stereotype.Service;

import com.iboxpay.open.auth.center.validate.ParamValidate;

/**
 * 
 * RefreshTokenValidate.java
 * @author xuxiao
 * @date 2018/06/20
 */
@Service
public class RefreshTokenValidate implements ParamValidate {

    @Override
    public void validate(Map<String, Object> requestMap) {
        String refreshToken = requestMap.get(ParamEnums.refreshToken.getCode()) == null ? "" : (String)requestMap.get(ParamEnums.refreshToken.getCode());
        if (StringUtils.isBlank(refreshToken)) {
            throw new ParamValidateException(ResultEnums.refreshTokenIncorrect);
        }
    }

}
